package com.zy.springcloud.cloudconsumeruser;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;
@EnableDiscoveryClient
@SpringBootApplication
public class CloudConsumerUserRestTemplateApplication {
    @LoadBalanced //服务间调用添加负载均衡
    //使用远程调用
    @Bean
    public RestTemplate restTemplate() {
        return new RestTemplate();

    }


    public static void main(String[] args) {
        SpringApplication.run(CloudConsumerUserRestTemplateApplication.class, args);
    }

}
